const INIT_PANELS = 'INIT_PANELS';
const INIT_GRIDS = 'INIT_GRIDS';
const INIT_MODALS = 'INIT_MODALS';
const RESET_MODALS = 'RESET_MODALS';
const SET_MODALS_PARAM = 'SET_MODALS_PARAM';

// 初始化tab页内容
const initPanels = (tab, activeKey) => {
  return {
    type: INIT_PANELS,
    tab,
    activeKey
  }
};

// 初始化表格相关
const initGrids = (param, handler, context) => {
  return {
    type: INIT_GRIDS,
    param,
    handler,
    context
  }
};

const initModals = (key, visible, param, handler, context) => {
  return {
    type: INIT_MODALS,
    key,
    visible,
    param,
    handler,
    context
  }
};

const resetModals = (key, handler) => {
  return {
    type: RESET_MODALS,
    key,
    handler
  }
}

const setModalsParam = (key, param) => {
  return {
    type: SET_MODALS_PARAM,
    key,
    param
  }
}

export {
  INIT_PANELS,
  initPanels,
  INIT_GRIDS,
  initGrids,
  INIT_MODALS,
  initModals,
  RESET_MODALS,
  resetModals,
  SET_MODALS_PARAM,
  setModalsParam
};